// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const { OPENID } = cloud.getWXContext();
  const DB1 = cloud.database().collection('coupon');
  const _ = cloud.database().command;
  let { type } = event;
  if (type == 'getcoupon_list'){
    return await DB1.where({show_address:'pages',number:_.gt(0)}).get();
  }
 
}